package com.sline.servlet.demo1_servlet._03_forward_redirect;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/forward/b")
public class bServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html; charset-utf-8");

        PrintWriter writer = resp.getWriter();

        String name = req.getParameter("name");
        System.out.println("bServlet ----- before ----- name = " + name);
        writer.println("bServlet ----- before");
    }
}
